#include <iostream>
#include <cstring>
#include <algorithm>

using namespace std;

const int N = 1010;
const int M = 10;

int f[N][M];
int m, n;

int main()
{
    cin >> n >> m;
    for (int i = 1; i <= n; i++)
        for (int j = 0; j < m; j++)
            scanf("%d", &f[i][j]);

    for (int i = 1; i <= n; i++)
    {
        int id = 0;
        for (int j = 1; j <= n; j++)
        {
            bool is_bigger = true;
            for (int k = 0; k < m; k++)
            {
                if (f[j][k] <= f[i][k])
                {
                    is_bigger = false;
                    break;
                }
            }
            if (is_bigger)
            {
                id = j;
                break;
            }
        }
        printf("%d\n", id);
    }
    return 0;
}